<?php
/**
 * SocialEngine
 *
 * @category   Application_Core
 * @package    Payment
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 * @version    $Id: PayPal.php 8221 2011-01-15 00:24:02Z john $
 * @author     John Boehr <j@webligo.com>
 */

/**
 * @category   Application_Core
 * @package    Payment
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.net/license/
 */
class Payment_Form_Admin_Gateway_PayPal extends Payment_Form_Admin_Gateway_Abstract {
	public function init() {
		parent::init ();
		
		$this->setTitle ( 'Payment Gateway: PayPal' );
		
		$description = $this->getTranslator ()->translate ( 'PAYMENT_FORM_ADMIN_GATEWAY_PAYPAL_DESCRIPTION' );
		$description = vsprintf ( $description, array ('https://www.paypal.com/us/cgi-bin/webscr?cmd=_profile-api-signature', 'https://www.paypal.com/us/cgi-bin/webscr?cmd=_profile-ipn-notify', 'http://' . $_SERVER ['HTTP_HOST'] . Zend_Controller_Front::getInstance ()->getRouter ()->assemble ( array ('module' => 'payment', 'controller' => 'ipn', 'action' => 'PayPal' ), 'default', true ) ) );
		$this->setDescription ( $description );
		
		// Decorators
		$this->loadDefaultDecorators ();
		$this->getDecorator ( 'Description' )->setOption ( 'escape', false );
		
		// Elements
		$this->addElement ( 'Text', 'username', array ('label' => 'API Username', 'filters' => array (new Zend_Filter_StringTrim () ) ) );
		
		$this->addElement ( 'Text', 'password', array ('label' => 'API Password', 'filters' => array (new Zend_Filter_StringTrim () ) ) );
		
		$this->addElement ( 'Text', 'signature', array ('label' => 'API Signature', //'description' => 'You only need to fill in either Signature or ' .
		//    'Certificate, depending on what type of API account you create.',
		'filters' => array (new Zend_Filter_StringTrim () ) ) );
		
	/*
    $this->addElement('Textarea', 'certificate', array(
      'label' => 'API Certificate',
      'description' => 'You only need to fill in either Signature or ' .
          'Certificate, depending on what type of API account you create.',
    ));
     * 
     */
	}
}